#ifndef QTOOLBARBUTTON_H
#define QTOOLBARBUTTON_H

#include <QToolButton>
#include <QAction>

class QToolBarButton: public QToolButton
{
    Q_OBJECT
    Q_PROPERTY(float fader READ fader WRITE setFader)

public:
    QToolBarButton(QAction *action,QWidget *parent = 0);

    void paintEvent(QPaintEvent *event);
    bool event(QEvent *e);
    QSize sizeHint() const;
    QSize minimumSizeHint() const;

    float m_fader;
    float fader() { return m_fader; }
    void setFader(float value) { m_fader = value; update(); }

    void forceVisible(bool visible);

private slots:
    void actionChanged();

private:
    bool m_hasForceVisible;
};

#endif // QTOOLBARBUTTON_H
